﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Enterprises.Wpf.Core.Localization
{
    /// <summary>
    /// 系统的字符串资源及多语言
    /// </summary>
    public static class StringResources
    {
        /// <summary>
        /// 获取或设置系统的语言选项
        /// </summary>
        public static DefaultLanguage Language;

        static StringResources()
        {
            Language = new DefaultLanguage();
            if (CultureInfo.CurrentCulture.ToString().StartsWith("zh"))
            {
                SetLanguageChinese();
            }
            else
            {
                SeteLanguageEnglish();
            }
        }

        /// <summary>
        /// 将语言设置为中文
        /// </summary>
        public static void SetLanguageChinese()
        {
            Language = new DefaultLanguage();
        }

        /// <summary>
        /// 将语言设置为英文
        /// </summary>
        public static void SeteLanguageEnglish()
        {
            Language = new English();
        }
    }
}
